
var aap= angular.module('myApp', []).
config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/', {templateUrl: 'credit_note_form.html', controller: ListCnoteCtrl}).
                 when('/gencrdnote/{clist.Name}', {templateUrl: 'credit_note_form.html', controller: ListCnoteCtrl}).
      otherwise({redirectTo: '/'});
}]);

 
function ListCnoteCtrl($scope, $http, $window,$location) {
  $http.get('credit_note_form_data.php').success(function(data)
    {
        $scope.cnotedata = data;
  });
  
  $http.get('customer_creditnote_data.php').success(function(data1) {
    $scope.customermast = data1;
  });
  
   $scope.gencrdnote = function(clist) 
   {   
	   var url = 'credit_note_form_generatenote_data.php?custid='+clist.custid;
       $http.get(url).success(function(data)
       {
            $window.alert("Credit Note Created for "+clist.custid +","+ ","+ clist.Name);
       });
  };
}


 